<!DOCTYPE html>
<html><head lang="en">
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <link rel="stylesheet" href="css/user/public.css">
    <link rel="stylesheet" href="css/user/index.css">
    <!--引入CSS-->
    <link rel="stylesheet"  href="css/user/webuploader.css">
    <link rel="stylesheet"  href="css/user/bootstrap-datepicker.css">

    <!--引入JS-->

    <script language="javascript" type="text/javascript" src="js/user/jquery-1.8.3.min.js"></script>
    <script language="javascript" type="text/javascript" src="js/user/index.js"></script>
    <script language="javascript" type="text/javascript" src="js/user/area.js"></script>
    <script language="javascript" type="text/javascript" src="js/user/uploadPreview.js"></script>
    <script language="javascript" type="text/javascript" src="js/user/webuploader.js"></script>
 		<script language="javascript" type="text/javascript" src="js/user/jquery.timepicker.js"></script>
    <script language="javascript" type="text/javascript" src="js/user/bootstrap-datepicker.js"></script>
    <script charset="utf-8" src="js/user/ajaxfileupload.js"></script>
    <script charset="utf-8" src="js/user/lt-upload-file.js"></script>
    <script>
       
    </script>
    <style>.datepicker{position: absolute;}</style>
    <title>个人资料</title>
</head>
<body>
<!--top-->
<div class="contact_main">
    <div class="contact_main_title_tab">
        <p><span><a class="base_infor_on">个人资料</a><img src="images/line_small.png"><a>身份认证</a><img src="images/line_small.png"><a>投资认证</a><img src="images/line_small.png"></span></p>
    </div>
    <div class="contact_main_cont_person">
        <form id="base_box_info">
            <div class="base_infor_form base_infor_form_add">
                <!--<p><span>用户名：</span><input type="text" value="lily.liu" class="inp_bor" readonly/></p>-->
                <!--<p><span>性别：</span><select class="base_infor_form_xg" disabled><option>女</option><option>男</option></select><a class="base_infor_form_btn_xg">修改</a><a class="base_infor_form_btn_add">确定</a></p>-->
                <!--<p><span>手机：</span><input class="base_infor_form_xg" type="text" value="15968456789" disabled><a class="base_infor_form_btn_xg">修改</a><a class="base_infor_form_btn_add">确定</a></p>-->
                <!--<p><span>邮箱地址：</span><input class="base_infor_form_xg" type="text" value="myl@163.com" disabled><a class="base_infor_form_btn_xg">修改</a><a class="base_infor_form_btn_add">确定</a></p>-->
                <!--<p><span>登录密码：</span><input class="base_infor_form_xg" type="password" value="3333333333" disabled><a class="base_infor_form_btn_xg">修改</a><a class="base_infor_form_btn_add">确定</a></p>-->
                <!--<p><span>身份证号码：</span><input type="text" value="339876456789098765" class="inp_bor" readonly/></p>-->
            </div>
            <div class="base_infor_form">
                <p><span>所在地区：</span>
                    <select class="base_infor_form_addr" id="s_province" name="s_province"></select>
                    <select class="base_infor_form_addr" id="s_city" name="s_city" ></select></p>
                <p><span>个人说明：</span><textarea class="base_person_sm"></textarea></p>
            </div>
            <p class="release_btn_tj_box"><input id="base_person_info" type="button" value="提交" class="release_btn_tj"></p>
        </form>
    </div>
    <div class="contact_main_cont_Idcar">
        <div class="base_idCar_ts">
            <p class="base_idCar_ts_red">您还未申请身份认证</p>
            <p>领投承诺：身份证信息仅用于创业者在领投投融资的证明材料！</p>
        </div>
        <div class="base_idCar_cont">
            <div class="base_idCar_cont_left">
                <div class="base_idCar_cont_left_top">
                    <p class="base_idCar_cont_left_photo"><span>上传身份证正面照片：</span></p>
                    <div  class="base_idCar_cont_left_photo">
                        <p><a id="fileHelpBtn" class="a-upload"><input type="file" name="photoFileHelp" id="photoFileHelp" onChange="document.getElementById('subPhotoHelp').click();" style="display:none;" />选择您要上传的文件</a></p>
          							 <input type="button" name="subPhotoHelp" id="subPhotoHelp" value="确认上传" style="display:none;"/>
                        <div id="imgdiv"><img  width="150" height="150" id="imgShow" src="images/none_03.png"/></div>
                        
                        <div class="cleardiv"></div>
                        <p><a class="a-upload_yl">正面预览</a></p>
                    </div>
                    <div class="cleardiv"></div>
                </div>
                <div class="base_idCar_cont_left_top">
                    <p class="base_idCar_cont_left_photo"><span>上传身份证反面照片：</span></p>
                    <div  class="base_idCar_cont_left_photo">
                        <p><a id="fileHelpBtn1" class="a-upload"><input type="file" name="photoFileHelp" id="photoFileHelp1" onChange="document.getElementById('subPhotoHelp1').click();" style="display:none;" />选择您要上传的文件</a></p>
                         <input type="button" name="subPhotoHelp1" id="subPhotoHelp1" value="确认上传" style="display:none;"/>
                        <div id="imgdiv1"><img  width="150" height="150" id="imgShow1" src="images/none_03.png"/></div>
                        <div class="cleardiv"></div>
                        <p><a class="a-upload_yl">反面预览 </a></p>
                    </div>
                    <div class="cleardiv"></div>
                </div>
                <p class="base_idCar_cont_left_ts">温馨提示：请上传JPG/GIF/PNG格式图片，文件大小控制在1M以内！</p>
            </div>
            <div class="base_idCar_cont_right">
                <div class="base_idCar_cont_right_bg">
                    <p>样板参考</p>
                    <img src="images/member_base_id.png" >
                </div>
                <p><a href="#">如何正确上传身份证正反照</a></p>
            </div>
            <div class="cleardiv"></div>
        </div>

        <p class="Idcar_btn"><input type="submit" value="申请认证"></p>
    </div>
    <div class="contact_main_cont_tz">
        <form id="base_tz_box">
            <div class="base_infor_form_tz_title">
                <p class="base_infor_form_tz_choose"><span>用户类型：</span><i><input id="base_user_type" type="radio" value="天使投资人" name="tz" checked/><label>天使投资人</label></i><i><input type="radio" value="投资机构" name="tz"/><label>投资机构</label></i></p>
            </div>
            <div class="base_infor_form_tz_choose_one">
                <div class="base_infor_form_tz" style="padding-top:0;">
                    <p class="base_infor_form_tz_qj"><span>投资区间：</span><select class="base_tz_qj_small"><option value="100">10</option><option value="100">50</option><option value="100">200</option><option value="100">500</option></select><em>~</em><select class="base_tz_qj_big"><option value="100">50</option><option value="100">200</option><option value="100">500</option><option value="100">1000</option></select></p>
                    <p class="base_tz_jy_btn"><span>投资经验：</span><i><input type="radio" name="jy" checked/><label>PE/VC</label></i><i><input type="radio" name="jy"/><label>天使投资</label></i><i><input type="radio" name="jy"/><label>其它</label></i></p>
                    <p><span>公司名称：</span><input type="text" class="base_tz_comp_name"></p>
                    <p><span>职务：</span><input type="text" class="base_tz_comp_zw"></p>
                    <p class="base_infor_form_tz_lv"><span>投资履历：</span></p>
                    <div>
                        <div class="base_infor_form_tz_lv_cont_box">
                            <div class="base_infor_form_tz_lv_cont">
                                <p><span>被投公司：</span><input type="text" class="base_tz_comp"></p>
                                <p class="base_infor_form_tz_qj1" id="basicExample"><span>投资时间：</span><input type="text" class="date start" /><em>~</em><input type="text" class="date end" /></p>
                                <p class="base_infor_form_tz_qj1"><span>投资金额：</span><input type="text" class="base_tz_money"><em>w</em></p>
                                <p class="base_infor_form_tz_qj1"><span>已获收益：</span><input type="text" class="base_tz_sy"><em>w</em></p>
                                <p><span>项目简介：</span><textarea class="base_tz_jj" name="message" cols="28" rows="5" onKeyDown="textCounter(message,remLen,100);" onKeyUp="textCounter(message,remLen,100);"></textarea><span class="release_ts"><em class="textCount"><input name="remLen" type="text" readonly value="0"></em>/100</span></p>
                            </div>
                        </div>
                        <div class="cleardiv"></div>
                    </div>
                    <div class="cleardiv"></div>

                    <p><a href="javascript:void (0);" class="cont_add" onclick="add_cont();">继续添加</a></p>
                    <p class="base_idCar_cont_left_photo"><span>投资人荣誉证书：</span></p>
                    <div  class="base_idCar_cont_left_photo">
                   		 	<p><a id="fileHelpBtn2" class="a-upload"><input type="file" name="photoFileHelp" id="photoFileHelp2" onChange="document.getElementById('subPhotoHelp2').click();" style="display:none;" />选择您要上传的文件</a></p>
                        <input type="button" name="subPhotoHelp2" id="subPhotoHelp2" value="确认上传" style="display:none;"/>
                        <div id="imgdiv2"><img  width="150" height="150" id="imgShow2" src="images/none_03.png"/></div>
                        <!--
                        <p><a class="a-upload"><input type="file" id="up_img2" value="" style="border:none;">请上传</a></p>
                        <div id="imgdiv2"><img id="imgShow2" src="images/none_03.png"/></div> -->
                    </div>
                    <div class="cleardiv"></div>
                    <p class="base_pl"><span>投资理念：</span><textarea class="base_tz_ln" name="message1" cols="28" rows="5" onKeyDown="textCounter(message1,remLen1,100);" onKeyUp="textCounter(message1,remLen1,100);"></textarea><span class="release_ts"><em class="textCount"><input name="remLen1" type="text" readonly value="0"></em>/100</span></p>
                    <p class="base_pl"><span>提供附加价值：</span><textarea class="base_tz_jz" name="message2" cols="28" rows="5" onKeyDown="textCounter(message2,remLen2,100);" onKeyUp="textCounter(message2,remLen2,100);"></textarea><span class="release_ts"><em class="textCount"><input name="remLen2" type="text" readonly value="0"></em>/100</span></p>
                    <p><span>关注领域：</span><i>
                        <input type="checkbox" value="1" name="guanzhulingyu" checked/><label>智慧医疗</label></i><i>
                        <input type="checkbox" value="2" name="guanzhulingyu"/><label>互联网基础服务</label></i><i>
                        <input type="checkbox" value="3" name="guanzhulingyu"/><label>智能硬件</label></i><i>
                        <input type="checkbox" value="4" name="guanzhulingyu"/><label>电子商务</label></i><i>
                        <input type="checkbox" value="5" name="guanzhulingyu"/><label>互联网金融</label></i><i>
                        <input type="checkbox" value="6" name="guanzhulingyu"/><label>物联网</label></i><i>
                        <input type="checkbox" value="7" name="guanzhulingyu"/><label>传统</label></i><i>
                        <input type="checkbox" value="8" name="guanzhulingyu"/><label>其他</label></i></p>
                    <div class="cleardiv"></div>
                </div>
                <p class="release_btn_tj_box"><input type="submit" id="base_tz_person" value="提交" class="release_btn_tj"></p>
                <div class="cleardiv"></div>
            </div>
            <div class="base_infor_form_tz_choose_two">
                <div class="base_infor_form_tz" style="padding-top:0;">
                    <p class="base_infor_form_tz_qj"><span>投资区间</span><select id="base_qj_small"><option>100万</option></select><em>~</em><select id="base_qj_big"><option>100万</option></select></p>
                    <p class="base_tz_jy"><span>投资经验：</span><i><input type="radio" checked name="base_tz"/><label>PE/VC</label></i><i><input type="radio" name="base_tz"/><label>天使投资</label></i><i><input type="radio" name="base_tz"/><label>其它</label></i></p>
                    <p><span>公司名称：</span><input type="text" class="base_invest_comp_name"></p>
                    <p><span>公司地址：</span><input type="text" class="base_invest_comp_addr"></p>
                </div>
                <div class="base_infor_form_tz">
                    <p class="base_idCar_cont_left_photo"><span>营业执照扫描件：</span></p>
                    <div  class="base_idCar_cont_left_photo">
                        <p><a class="a-upload"><input type="file" id="up_img3" value="" style="border:none;">请选择文件</a></p>
                        <div id="imgdiv3"><img  width="150" height="150" id="imgShow3" src="images/none_03.png"/></div>
                        <p class="tz_ts">温馨提示：请上传JPG/GIF/PNG格式图片，文件大小控制在5M以内！</p>
                        <div class="cleardiv"></div>
                        <p><a class="a-upload_yl">预览</a></p>
                    </div>
                    <div class="cleardiv"></div>
                    <p><span>投资人电话：</span><input type="text" class="base_invest_comp_phone"></p>
                    <p><span>投资人邮箱：</span><input type="text" class="base_invest_comp_email"></p>
                    <p><span>投资理念：</span><input type="text" class="base_invest_comp_ln"></p>
                    <p><span>可提供附加价值：</span><input type="text" class="base_invest_comp_jz"></p>
                    <p><span>关注领域：</span><i><input type="checkbox" checked value="1" name="base_invest_ly"/><label>智慧医疗</label></i><i><input type="checkbox" value="2" name="base_invest_ly"/><label>互联网基础服务</label></i><i><input type="checkbox" value="3" name="base_invest_ly"/><label>智能硬件</label></i><i><input type="checkbox" value="4" name="base_invest_ly"/><label>电子商务</label></i><i><input type="checkbox" value="5" name="base_invest_ly"/><label>互联网金融</label></i><i><input type="checkbox" value="6" name="base_invest_ly"/><label>物联网</label></i><i><input type="checkbox" value="7" name="base_invest_ly"/><label>传统</label></i><i><input type="checkbox" value="8" name="base_invest_ly"/><label>其他</label></i></p>
                </div>
                <p class="release_btn_tj_box"><input type="button" value="提交" class="release_btn_tj" id="release_tz_jg"></p>
            </div>
        </form>
    </div>
    <script type="text/javascript">_init_area();</script>
 
</div>
<!--main-->

<script>
	  $(document).ready(function(){
	
			$("#fileHelpBtn").click(function() {
				document.getElementById("photoFileHelp").click();
			});
			$("input#subPhotoHelp").click(function() {
				ajaxFileUpload4Add("/lt/file/upload", "imgShow", "photoFileHelp");
			});
			
			$("#fileHelpBtn1").click(function() {
				document.getElementById("photoFileHelp1").click();
			});
			$("input#subPhotoHelp1").click(function() {
				ajaxFileUpload4Add("/lt/file/upload", "imgShow1", "photoFileHelp1");
			});
			
			//荣誉证书
			 $("#fileHelpBtn2").click(function() {
				document.getElementById("photoFileHelp2").click();
			});
			$("input#subPhotoHelp2").click(function() {
				ajaxFileUpload4Add("/lt/file/upload", "imgShow2", "photoFileHelp2");
			});
  	});
	
    $(document).ready(function(){
        $.ajax({
            url:"/lt/user/getUserInfo",
            data:"",
            type:"get",
            success:function(data){
                if(data.result==1){
                    alert(data.resultMsg);
                }else{
                    var inforData = data.data;

                        var sex=inforData.sex;
                        if(sex=="0") {
                            sex = "女";
                        } else if(sex=="1") {
                            sex = "男";
                        } else {
                        	sex = "";
                        }
                        var html="<p><span>用户名：</span><input id='base_userName' type='text' value='"+inforData.userName+"' class='inp_bor' readonly/></p>" +
                                "<p><span>性别：</span><input id='base_sex' type='text' value='"+sex+"' class='inp_bor ' disabled/><select class='base_infor_form_xg base_xg_none' disabled><option>女</option><option>男</option></select><a class='base_infor_form_btn_xg base_info_xg'>修改</a><a class='base_infor_form_btn_add base_info_add'>确定</a></p>" +
                                "<p><span>手机：</span><input id='base_phone' class='base_infor_form_xg' type='text' value='"+inforData.phone+"' disabled><a class='base_infor_form_btn_xg'>修改</a><a class='base_infor_form_btn_add'>确定</a></p>" +
                                "<p><span>邮箱地址：</span><input id='base_email' class='base_infor_form_xg' type='text' value='"+inforData.email+"' disabled><a class='base_infor_form_btn_xg'>修改</a><a class='base_infor_form_btn_add'>确定</a></p>" +
                                "<p><span>登录密码：</span><input id='base_password' class='base_infor_form_xg' type='password' value='123456' disabled><a class='base_infor_form_btn_xg'>修改</a><a class='base_infor_form_btn_add'>确定</a></p>" +
                                "<p><span>身份证号码：</span><input id='base_idCard' type='text' value='"+inforData.idCardNumber+"' class='inp_bor' readonly/></p>";

                        $(".contact_main_cont_person .base_infor_form_add").append(html);
                        $(".base_person_sm").val(inforData.introduce)
                        var main = $(window.parent.document).find("#iframepage");
                        var thisheight = $(document).height();
                        main.height(thisheight);

										//执行填充所在地区
										setCity();
										function setCity(){//-------------------------------------------//填充所在地区函数
											var s_province = $('#s_province');
											var s_city = $('#s_city');
											var cityCode = inforData.cityCode + '';
											var cityCodePrev = cityCode.substring(0,3)+'00000';
											
											s_province.val(cityCodePrev);
											s_province.change();
											s_city.val(cityCode);
												
										}
					
                }
            }
        });

        $('#base_person_info').click(function(){

                var id;
                var baseName = $("#base_userName").val();
                var baseSex=$("#base_sex").val();
                var basePhone = $(".base_phone").val();
                var baseEmail = $("#base_email").val();
                var basePassword = $("#base_password").val();
                var baseIdCard = $("#base_idCard").val();
                var baseP=$("#s_province").find("option:selected").val();
                var baseCity=$("#s_city").find("option:selected").val();
                var basePersonSm=$(".base_person_sm").val();
//                alert(project_release_person);
                if(baseSex=="女") {
                    baseSex = "0";
                }
                if(baseSex=="男") {
                    baseSex = "1";
                }
            /*if(baseCity!=""||baseP!=""){
                var cityCode=baseCity
            }*/
            var cityCode1 = baseCity || baseP;

            $.ajax({
                    url:"lt/user/saveUserInfo",
                    data:JSON.stringify({userName:baseName,cityCode:cityCode1,sex:baseSex,phone:basePhone,email:baseEmail,password:basePassword,idCardNumber:baseIdCard,introduce:basePersonSm}),
                   
                     type:"POST",
               			 contentType: "application/json",
               			 dataType:"json",
                    success:function(data){
                        if(data.result==1){
                            alert(data.resultMsg);
                        }else{
                            $('#base_box_info').submit();

                        }
                    }
                });
        });

        $('#base_tz_person').click(function(){
//            天使投资人
            var id;
            var base_type =$('input:radio[name="tz"]:checked').val();
            var base_small=parseInt($(".base_tz_qj_small").find("option:selected").val());
            var base_big=parseInt($(".base_tz_qj_big").find("option:selected").val());
            var base_jy =$('.base_tz_jy_btn input:radio[name="jy"]:checked').val();
            var base_name = $(".base_tz_comp_name").val();
            var base_zw = $(".base_tz_comp_zw").val();
            var baseIdCard = $("#base_idCard").val();
            var base_ln=$(".base_tz_ln").val();
            var base_jz=$(".base_tz_jz").val();
            //获取投资案例
            var aBase_infor = new Array;
            var nLength = $('.base_infor_form_tz_lv_cont').length;
			
            for(var i =0; i<nLength; i++){
                var company = $('.base_tz_comp').eq(i).val();
                var startTime = $('.start').eq(i).val();
                var endTime = $('.end').eq(i).val();
                var investMoney = $('.base_tz_money').eq(i).val();
                var benefit = $('.base_tz_sy').eq(i).val();
                var introduce = $('.base_tz_jj').eq(i).val();
                aBase_infor.push({company:company,startTime:startTime,endTime:endTime,investMoney:investMoney,benefit:benefit,introduce:introduce})
            }
			console.log(nLength);
//            console.log(base_small);
            //天使投资人获取关键领域
            var guanzhulingyuText = '';
            var nGZLength = $('input[name=guanzhulingyu]').length;
          console.log(nGZLength);
            for(var j = 0; j <nGZLength ;j++){
                if ($('input[name=guanzhulingyu]').eq(j).attr('checked')) {
                    guanzhulingyuText += $('input[name=guanzhulingyu]').eq(j).val()+',';
                }
            }
            guanzhulingyuText = guanzhulingyuText.substr(0,guanzhulingyuText.length-1);
//            alert(guanzhulingyuText)
            if(base_type=="天使投资人"){
             
            
				$.ajax({
					url:"lt/user/saveInvestorInfo",
					data:JSON.stringify({id:id,roleId:2,investMin:base_small,investMax:base_big,experience:base_jy,jobTitle:base_zw,investCase:JSON.stringify(aBase_infor),investIdea:base_ln,investAdditional:base_jz,investField:guanzhulingyuText}),

					type:"POST",
          contentType: "application/json",
          dataType:"json",
					success:function(data){
						if(data.result==1){
							alert(data.resultMsg);
						}else{
							//$('#base_tz_box').submit();
							alert("创建成功");
						}
					}
				});
			}
			return false;
        });
		
        $('#release_tz_jg').click(function(){
            //投资机构
            var id;
            var base_type =$('input:radio[name="tz"]:checked').val();
            var base_qj_small=$("#base_qj_small").find("option:selected").text();
            var base_qj_big=$("#base_qj_big").find("option:selected").text();
            var base_tz_jy =$('.base_tz_jy input:radio[name="base_tz"]:checked').val();
            var invest_comp_name = $(".base_invest_comp_name").val();
            var invest_comp_addr = $(".base_invest_comp_addr").val();
            var invest_comp_phone = $("#base_invest_comp_phone").val();
            var invest_comp_email=$(".base_invest_comp_email").val();
            var invest_comp_ln=$(".base_invest_comp_ln").val();
            var invest_comp_jz=$(".base_invest_comp_jz").val();
            //投资机构获取关键领域
            var base_invest_ly_text = '';
            var investLength = $('input[name=base_invest_ly]').length;

            for(var k = 0; k <investLength ;k++){
                if ($('input[name=base_invest_ly]').eq(k).attr('checked')) {
                    base_invest_ly_text += $('input[name=base_invest_ly]').eq(k).val()+',';
                }
            }
            base_invest_ly_text = base_invest_ly_text.substr(0,base_invest_ly_text.length-1);
            console.log(base_invest_ly_text);
            if(base_type=="投资机构"){
            
				$.ajax({
					url:"lt/user/saveInvestOrgInfo",
					data:JSON.stringify({id:id,roleId:2,investMin:base_qj_small,investMax:base_qj_big,experience:base_tz_jy,address:invest_comp_addr,contactor:invest_comp_phone,email:invest_comp_email,investIdea:invest_comp_ln,investAdditional:invest_comp_jz,investField:base_invest_ly_text}),

					type:"POST",
          contentType: "application/json",
          dataType:"json",
					success:function(data){
						if(data.result==1){
							alert(data.resultMsg);
						}else{
							//$('#base_tz_box').submit();
							alert("创建成功");
						}
					}
				});
			}
        });
    });
</script>

<script>
    $('#basicExample .date').datepicker({
        'format': 'yyyy-mm-dd',
        'autoclose': true
    });
    $('#basicExample .date').datepicker({
        'format': 'yyyy-mm-dd',
        'autoclose': true
    });

    //$('#basicExample').datepair();
</script>
</body>
</html>
